//
//  ViewController.m
//  GGTV
//
//  Created by apple on 15/10/22.
//  Copyright © 2015年 apple. All rights reserved.
//

#import "ViewController.h"
#import "CCTools.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    
    NSString *url = @"https://api.youku.com/quality/video/by/category.json";
    
    NSMutableDictionary *parm = [NSMutableDictionary dictionary];
    [parm setObject:@"bb394822970db730" forKey:@"client_id"];
    [parm setObject:@"10" forKey:@"cate"];
    [parm setObject:@"1" forKey:@"page"];
    [parm setObject:@"20" forKey:@"count"];
    
    [CCTools JSONDataToDictionaryWithUrl:url dictinory:parm success:^(id data) {
        NSLog(@"%@",data);
        
    } fail:^(NSError *error) {
        
    }];
    
    self.view.backgroundColor = [UIColor greenColor];
    
    UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(100, 100, 100, 100)];
    button.backgroundColor = [UIColor redColor];
    [button addTarget:self action:@selector(show) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
    
}
-(void)show
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
